---
title: "Create Knowledge Base"
api: "POST labs.chonkie.ai/api/v1/knowledge"
description: "Create a new knowledge base for storing and indexing documents"
---

Create a new knowledge base that can store documents, generate embeddings, and enable semantic search.

## Examples

<CodeGroup>

```python Python
import requests

url = "https://labs.chonkie.ai/api/v1/knowledge"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "name": "Product Documentation",
    "description": "Technical documentation for our products"
}

response = requests.post(url, headers=headers, json=data)
kb = response.json()

print(f"Created knowledge base: {kb['name']}")
print(f"Slug: {kb['slug']}")
```

```javascript JavaScript
const response = await fetch("https://labs.chonkie.ai/api/v1/knowledge", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Product Documentation",
    description: "Technical documentation for our products",
  }),
});

const kb = await response.json();
console.log(`Created knowledge base: ${kb.name}`);
console.log(`Slug: ${kb.slug}`);
```

```bash cURL
curl -X POST https://labs.chonkie.ai/api/v1/knowledge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Documentation",
    "description": "Technical documentation for our products"
  }'
```

</CodeGroup>

## Request

#### Parameters

<ParamField path="name" type="string" required>
  Name of the knowledge base. Will be used to generate a unique slug.
</ParamField>

<ParamField path="description" type="string">
  Optional description of what this knowledge base contains.
</ParamField>

## Response

#### Returns

<ResponseField name="slug" type="string">
  URL-safe slug generated from the name. Use this for subsequent API calls.
</ResponseField>

<ResponseField name="name" type="string">
  The knowledge base name.
</ResponseField>
